package com.syspeak.modules.spring.web.servlet;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver;

import com.syspeak.modules.spring.web.ReturnNullViewException;

public class SyspeakDefaultHandlerExceptionResolver extends DefaultHandlerExceptionResolver {

	@Override
	protected ModelAndView doResolveException(HttpServletRequest request, HttpServletResponse response, Object handler,
			Exception ex) {
		if (ex instanceof ReturnNullViewException) {
			return null;
		} else {
			return super.doResolveException(request, response, handler, ex);
		}
	}
}
